export default {
    state: {
        aAge: 200
    },
    mutations: {
        changeAge(state, payload) {
            state.age = payload;
        },
    },
    actions: {
        changeAge({ commit }, payload) {
            return new Promise((resolve, reject) => {
                setTimeout(() => {
                    commit('changeAge', payload)
                    resolve(payload);
                }, 1000);
            })
        }
    },
    modules: {
        a_children: {
            state: {
                aAge: 203
            },
            mutations: {
                changeAge(state, payload) {
                    state.age = payload;
                },
            },
            actions: {
                changeAge({ commit }, payload) {
                    return new Promise((resolve, reject) => {
                        setTimeout(() => {
                            commit('changeAge', payload)
                            resolve(payload);
                        }, 1000);
                    })
                }
            },
        }
    }
}
